package com.zara.store.server;

import java.math.BigDecimal;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.OneToOne;

@Entity
public class Invoice {
	private int id;
	private InvoiceClient client;
	private BigDecimal total;
	private BigDecimal taxIVA;
	private String invoiceType;
	private BigDecimal subTotal;
	private Date invoiceDate = new Date();
	

	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	public int getId(){
		return id;
	}

	public void setId(int newVal){
		id = newVal;
	}

	@OneToOne
	public InvoiceClient getClient() {
		return client;
	}

	public void setClient(InvoiceClient client) {
		this.client = client;
	}

	public void setTotal(BigDecimal total) {
		this.total = total;		
	}

	public void setTaxIVA(BigDecimal taxIVA) {
		this.taxIVA= taxIVA;		
	}

	public void setInvoiceType(String invoiceType) {
		this.invoiceType = invoiceType;		
	}

	@Column
	public String getInvoiceType() {
		return invoiceType;
	}

	@Column
	public BigDecimal getTaxIVA() {
		return taxIVA;
	}

	@Column
	public BigDecimal getTotal() {
		return total;
	}

	public void setSubTotal(BigDecimal subTotal) {
		this.subTotal = subTotal;
	}
	
	@Column
	public BigDecimal getSubTotal() {
		return subTotal;
	}

	@Column
	public Date getInvoiceDate() {
		return invoiceDate;
	}

	public void setInvoiceDate(Date invoiceDate) {
		this.invoiceDate = invoiceDate;
	}

}
